package springdoc.web;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiParam;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping(value = "/api/v1")
/**
 * 注意这里与springdoc-openapi-ui的有所不同
 * @Tag
 */
@Api(tags = "Nelson Mandela", value = "The greatest glory in living lies not in never falling, but in rising every time we fall.")
public class TestController {

    /**
     * swagger3 @Parameter和@ApiParam都能用
     * @param tgtLan
     * @param projectId
     */
    @Operation(summary = "Get string segment")
    @GetMapping(value = "/string/project/{projectId}/segment")
    public void getTestInfo(@Parameter(description = "目标语言", required = true)
                            @RequestParam(value = "tgt_lan") String tgtLan, @PathVariable String projectId) {
    }

    @Operation(summary = "Add string segment")
    @PostMapping(value = "/string/project/{projectId}/segment")
    public void addTestInfo(@ApiParam(value = "目标语言", required = true)
                            @PathVariable String projectId, @RequestBody List<String> list) {
    }

    @Operation(summary = "Delete string segment")
    @DeleteMapping(value = "/string/project/{projectId}/segment")
    public void getTestInfo(@PathVariable String projectId, @RequestBody List<String> list) {
    }
}
